<template>
  <div>
    <el-timeline>
      <el-timeline-item
        v-for="(activity, index) in activities"
        :key="index"
        color="#1990FE"
        :timestamp="activity.createTime | formatTimer">
        {{activity.unitName}}({{activity.userName}}) 执行了【{{activity.operation}}】
      </el-timeline-item>
    </el-timeline>
  </div>

</template>
<script>
import {
  getInvestigateOperation,
} from '@/services/model/investigation'
import Format from '@/utils/format'
export default {
  props: ['value','id'],
  data() {
    return {
      activities:[]
    }
  },
  methods: {
    async getInvestigateOperation(id){
      this.activities = []
      let {data} = await  getInvestigateOperation({id:id})
      this.activities = data || []
      return true
    }
  },
  mounted() {
  },
  created() {
  },
  activated() {
  },
  computed: {
  },
  filters:{
    // 时间格式化
    formatTimer(timer) {
      if (timer) {
        return Format(new Date(timer), 'yyyy-MM-dd hh:mm:ss')
      }
      return ''
    },
  }


}
</script>

<style lang="less">

</style>
